<template>
	<view class="container">
		<view class="history-list">
			<view class="history-item" v-for="(item, index) in historyList" :key="index">
				<view class="item-header">
					<text class="date">{{item.date}}</text>
					<text class="status" :class="item.status">{{item.statusText}}</text>
				</view>
				<view class="item-content">
					<text class="amount">{{item.amount}}L</text>
					<text class="price">￥{{item.price}}</text>
				</view>
				<view class="item-footer">
					<text class="order-no">订单号：{{item.orderNo}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			historyList: [
				{
					date: '2025-02-20',
					status: 'success',
					statusText: '已完成',
					amount: 200,
					price: 380,
					orderNo: 'WO202502200001'
				},
				{
					date: '2025-02-15',
					status: 'success',
					statusText: '已完成',
					amount: 100,
					price: 200,
					orderNo: 'WO202502150001'
				}
			]
		}
	}
}
</script>

<style lang="scss" scoped>
.container {
	padding: 20rpx;
	background: #f5f5f5;
	min-height: 100vh;
}

.history-item {
	background: #fff;
	border-radius: 12rpx;
	padding: 20rpx;
	margin-bottom: 20rpx;
	
	.item-header {
		display: flex;
		justify-content: space-between;
		margin-bottom: 20rpx;
		
		.date {
			font-size: 28rpx;
			color: #666;
		}
		
		.status {
			font-size: 28rpx;
			
			&.success {
				color: #52c41a;
			}
			
			&.pending {
				color: #faad14;
			}
			
			&.failed {
				color: #ff4d4f;
			}
		}
	}
	
	.item-content {
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-bottom: 20rpx;
		
		.amount {
			font-size: 36rpx;
			font-weight: bold;
			color: #333;
		}
		
		.price {
			font-size: 32rpx;
			color: #ff6b6b;
		}
	}
	
	.item-footer {
		.order-no {
			font-size: 24rpx;
			color: #999;
		}
	}
}
</style>
